package com.qingneng.dao;

import java.util.List;

import com.qingneng.vo.BudgetFeeDoInfo;
import com.qingneng.vo.BudgetItem;
import com.qingneng.vo.BudgetQuantitiesBuildItem;
import com.qingneng.vo.BudgetWorkDoInfo;
import com.qingneng.vo.BudgetWorkQuantities;
import com.qingneng.vo.ProjectWorkInfo;
import com.qingneng.vo.QantitiesBuildItem;
import com.tbfs.common.AbsBaseDaoImpl;

public class WorkBudgetDao extends AbsBaseDaoImpl {

	@Override
	protected String getInsertSql() {
		// TODO Auto-generated method stub
		return "qn_db_projectWorkinfo.insert_workQuantities_sql";
	}

	@Override
	protected String getUpdateByPrimaryKeySql() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected String getUpdateByPrimaryKeySelectiveSql() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected String getDeleteByPrimaryKeySql() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected String getQueryBySelectiveSql() {
		return "qn_db_projectWorkinfo.select_budgetWorkQuantities_by_selective_sql";
	}

	@Override
	protected String getQueryBySelectiveCountSql() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected String getSelectByEntityIdSql() {
		// TODO Auto-generated method stub
		return null;
	}

	
	public List queryWorkItem(BudgetItem budgetItem){
		return getSqlMapClientTemplate().queryForList("qn_db_projectWorkinfo.select_budgetItem_by_selective_sql", budgetItem);
	}
	
	public List queryFeeItem(){
		return getSqlMapClientTemplate().queryForList("qn_db_projectWorkinfo.select_feeItem_by_selective_sql");
	}
	/**
	 * 保存预算表结果
	 * @param bean
	 */
	public void insertBudgeWorkDoInfo(BudgetWorkDoInfo bean){
		 getSqlMapClientTemplate().insert("qn_db_projectWorkinfo.insert_budget_workdoinfo_sql", bean);
	}
	/**
	 * 保存取费表结果
	 * @param bean
	 */
	public void insertBudgeFeeDoInfo(BudgetFeeDoInfo bean){
		 getSqlMapClientTemplate().insert("qn_db_projectWorkinfo.insert_budget_fee_doinfo_sql", bean);
	}
	
	/**
	 * 获得取费表结果
	 * @param bean
	 */
	public List queryBudgeFeeDoInfo(BudgetFeeDoInfo bean){
		return getSqlMapClientTemplate().queryForList("qn_db_projectWorkinfo.query_budget_fee_doinfo_sql", bean);
	}
	
	/**
	 * 删除取费表结果，根据project_workinfo_id删除
	 * @param bean
	 */
	public void deleteBudgeFeeDoInfo(BudgetFeeDoInfo bean){
		 getSqlMapClientTemplate().delete("qn_db_projectWorkinfo.delete_budget_fee_doinfo_sql", bean);
	}
	
	/**
	 * 更新预算金额到工程信息表中
	 * @param bean
	 */
	public void updateBudgeFeeAmount(ProjectWorkInfo bean ){
		 getSqlMapClientTemplate().update("qn_db_projectWorkinfo.update_budget_fee_amount2workInfo_sql", bean);
	}
	
	/**
	 * 查询建筑类型
	 * @return
	 */
	public List queryBuildType() {
		List list = getSqlMapClientTemplate().queryForList("qn_db_projectWorkinfo.select_buildType_sql");
		return list;
	}
	/**
	 *×查询预算表结果信息
	 * @param bean
	 * @return
	 */
	public List queryWorkDoInfo(BudgetWorkDoInfo bean) {
		List list = getSqlMapClientTemplate().queryForList("qn_db_projectWorkinfo.select_budget_workdoinfo_sql",bean);
		return list;
	}
	
	/**
	 *×查询预算表结果信息
	 * @param bean
	 * @return
	 */
	public List queryWorkDoInfoByWorkInfoIdAndItemId(BudgetWorkDoInfo bean) {
		List list = getSqlMapClientTemplate().queryForList("qn_db_projectWorkinfo.select_budget_workdoinfo_result_by_workInfoId_sql",bean);
		return list;
	}
	
	/**
	 *删除计算后预算表量结果
	 * @param bean
	 * @return
	 */
	public void deleteWorkDoInfo(BudgetWorkDoInfo bean) {
		 getSqlMapClientTemplate().delete("qn_db_projectWorkinfo.delete_budget_work_doinfo_sql", bean);
	}
	
	/**
	 *删除计算后预算表量结果
	 * @param bean
	 * @return
	 */
	public void deleteSubWorkDoInfo(BudgetWorkDoInfo bean) {
		 getSqlMapClientTemplate().delete("qn_db_projectWorkinfo.delete_sub_budget_work_doinfo_sql", bean);
	}
	
	
	/**
	 *删除计算后工程量结果
	 * @param bean
	 * @return
	 */
	public void deleteWorkQuantities(BudgetWorkQuantities bean) {
		 getSqlMapClientTemplate().delete("qn_db_projectWorkinfo.delete_budget_workQuantities_doinfo_sql", bean);
	}
	
	/**
	 *更新计算后工程量平均容积结果
	 * @param bean
	 * @return
	 */
	public void updateWorkQuantities(BudgetWorkQuantities bean) {
		 getSqlMapClientTemplate().update("qn_db_projectWorkinfo.update_budgetWorkQuantities_by_selective_sql", bean);
	}
	
	
	
	/**
	 * 获得工程量中建筑类型项计算模板
	 * @param bean
	 */
	public List queryQuantitiesBuildItem(QantitiesBuildItem bean ) {
		 return getSqlMapClientTemplate().queryForList("qn_db_projectWorkinfo.select_quantities_build_item", bean);
	}
	
	/**
	 * 获得已经计算的工程量中建筑类型项
	 * @param bean
	 */
	public List queryBudgetQuantitiesBuildItem(BudgetQuantitiesBuildItem bean ) {
		 return getSqlMapClientTemplate().queryForList("qn_db_projectWorkinfo.select_budgetQuantities_build_item", bean);
	}
	
	/**
	 * 保存已经计算的工程量中建筑类型项
	 * @param bean
	 */
	public void insertBudgetQuantitiesBuildItem(BudgetQuantitiesBuildItem bean ) {
		  getSqlMapClientTemplate().insert("qn_db_projectWorkinfo.insert_budgetQuantities_build_item", bean);
	}
	/**
	 *删除计算已经计算的工程量中建筑类型项
	 * @param buildBean
	 * @return
	 */
	public void deleteBudgetQuantitiesBuildItem(BudgetQuantitiesBuildItem buildBean) {
		 getSqlMapClientTemplate().delete("qn_db_projectWorkinfo.delete_budgetQuantities_build_item", buildBean);
	}
		
	
}
